package com.sgcc.sx.pmos.e_sx_personalcenter.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.sgcc.pmos.nativesdk.R;

public class MessageAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public MessageAdapter() {
        super(R.layout.item_message);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, String s) {
        if (0 == getItemPosition(s)) {
            //系统消息
            baseViewHolder.setGone(R.id.top_view, false);
            baseViewHolder.setGone(R.id.bottom_view, false);
            baseViewHolder.setGone(R.id.view_line, true);
            baseViewHolder.setImageResource(R.id.iv_icon, R.mipmap.user_message_system);
            baseViewHolder.setText(R.id.tv_title, "系统消息");
        } else {
            //普通消息
            baseViewHolder.setGone(R.id.top_view, true);
            baseViewHolder.setGone(R.id.bottom_view, true);
            baseViewHolder.setGone(R.id.view_line, false);
            baseViewHolder.setImageResource(R.id.iv_icon, R.mipmap.user_message_deft_head);
        }
    }
}
